<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>v_hdmirxss: bigdigits.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">v_hdmirxss
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('bigdigits_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">bigdigits.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Interface to core BigDigits "mp" functions using fixed-length arrays. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ab56c606f91a4f8d105bbf3bbe0640b6c"><td class="memItemLeft" align="right" valign="top">typedef uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ab56c606f91a4f8d105bbf3bbe0640b6c">DIGIT_T</a></td></tr>
<tr class="memdesc:ab56c606f91a4f8d105bbf3bbe0640b6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The basic BigDigit element, an unsigned 32-bit integer.  <a href="#ab56c606f91a4f8d105bbf3bbe0640b6c">More...</a><br/></td></tr>
<tr class="separator:ab56c606f91a4f8d105bbf3bbe0640b6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a77bf097cd0692608f06b524ff1ef04db"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a77bf097cd0692608f06b524ff1ef04db">mpAdd</a> (u32 w[], const u32 u[], const u32 v[], size_t ndigits)</td></tr>
<tr class="memdesc:a77bf097cd0692608f06b524ff1ef04db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes w = u + v, returns carry.  <a href="#a77bf097cd0692608f06b524ff1ef04db">More...</a><br/></td></tr>
<tr class="separator:a77bf097cd0692608f06b524ff1ef04db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa160f8403c9e4e296c4cfe1afa98f5d7"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#aa160f8403c9e4e296c4cfe1afa98f5d7">mpSubtract</a> (u32 w[], const u32 u[], const u32 v[], size_t ndigits)</td></tr>
<tr class="memdesc:aa160f8403c9e4e296c4cfe1afa98f5d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes w = u - v, returns borrow.  <a href="#aa160f8403c9e4e296c4cfe1afa98f5d7">More...</a><br/></td></tr>
<tr class="separator:aa160f8403c9e4e296c4cfe1afa98f5d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa57007f55945e5caad5fa4e4da0ab2ec"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#aa57007f55945e5caad5fa4e4da0ab2ec">mpMultiply</a> (u32 w[], const u32 u[], const u32 v[], size_t ndigits)</td></tr>
<tr class="memdesc:aa57007f55945e5caad5fa4e4da0ab2ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes product w = u * v.  <a href="#aa57007f55945e5caad5fa4e4da0ab2ec">More...</a><br/></td></tr>
<tr class="separator:aa57007f55945e5caad5fa4e4da0ab2ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a9beba8b1b46a0f415197f512dff569"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide</a> (u32 q[], u32 r[], const u32 u[], size_t udigits, u32 v[], size_t vdigits)</td></tr>
<tr class="memdesc:a2a9beba8b1b46a0f415197f512dff569"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes integer division of u by v such that u=qv+r.  <a href="#a2a9beba8b1b46a0f415197f512dff569">More...</a><br/></td></tr>
<tr class="separator:a2a9beba8b1b46a0f415197f512dff569"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e3034074cb07fb9b9764d3448c03ab6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a8e3034074cb07fb9b9764d3448c03ab6">mpModulo</a> (u32 r[], const u32 u[], size_t udigits, u32 v[], size_t vdigits)</td></tr>
<tr class="memdesc:a8e3034074cb07fb9b9764d3448c03ab6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes remainder r = u mod v.  <a href="#a8e3034074cb07fb9b9764d3448c03ab6">More...</a><br/></td></tr>
<tr class="separator:a8e3034074cb07fb9b9764d3448c03ab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2504130118989f74890ebe55abf2beb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ac2504130118989f74890ebe55abf2beb">mpSquare</a> (u32 w[], const u32 x[], size_t ndigits)</td></tr>
<tr class="memdesc:ac2504130118989f74890ebe55abf2beb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes square w = x^2.  <a href="#ac2504130118989f74890ebe55abf2beb">More...</a><br/></td></tr>
<tr class="separator:ac2504130118989f74890ebe55abf2beb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d06f675857ffa2d8cf5c06e40ce1f98"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt</a> (u32 s[], const u32 x[], size_t ndigits)</td></tr>
<tr class="memdesc:a0d06f675857ffa2d8cf5c06e40ce1f98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes integer square root s = floor(sqrt(x))  <a href="#a0d06f675857ffa2d8cf5c06e40ce1f98">More...</a><br/></td></tr>
<tr class="separator:a0d06f675857ffa2d8cf5c06e40ce1f98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a453714cb1ce75fc02fceceaf8b35a75a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot</a> (u32 s[], const u32 x[], size_t ndigits)</td></tr>
<tr class="memdesc:a453714cb1ce75fc02fceceaf8b35a75a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes integer cube root s = floor(cuberoot(x))  <a href="#a453714cb1ce75fc02fceceaf8b35a75a">More...</a><br/></td></tr>
<tr class="separator:a453714cb1ce75fc02fceceaf8b35a75a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a934236a4337de87363660bc227aece52"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a934236a4337de87363660bc227aece52">mpEqual</a> (const u32 a[], const u32 b[], size_t ndigits)</td></tr>
<tr class="memdesc:a934236a4337de87363660bc227aece52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if a == b, else false, using constant-time algorithm.  <a href="#a934236a4337de87363660bc227aece52">More...</a><br/></td></tr>
<tr class="separator:a934236a4337de87363660bc227aece52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4688fa13c48155ed2cfc18ebef0e838f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a4688fa13c48155ed2cfc18ebef0e838f">mpCompare</a> (const u32 a[], const u32 b[], size_t ndigits)</td></tr>
<tr class="memdesc:a4688fa13c48155ed2cfc18ebef0e838f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns sign of <code>(a-b)</code> as <code>{-1,0,+1}</code> using constant-time algorithm.  <a href="#a4688fa13c48155ed2cfc18ebef0e838f">More...</a><br/></td></tr>
<tr class="separator:a4688fa13c48155ed2cfc18ebef0e838f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a328c19b60c24beb9f1f3a6b8cf341aa2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a328c19b60c24beb9f1f3a6b8cf341aa2">mpIsZero</a> (const u32 a[], size_t ndigits)</td></tr>
<tr class="memdesc:a328c19b60c24beb9f1f3a6b8cf341aa2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if a is zero, else false, using constant-time algorithm.  <a href="#a328c19b60c24beb9f1f3a6b8cf341aa2">More...</a><br/></td></tr>
<tr class="separator:a328c19b60c24beb9f1f3a6b8cf341aa2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3ecf0ae65f624c972903c0961863428"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ae3ecf0ae65f624c972903c0961863428">mpEqual_q</a> (const u32 a[], const u32 b[], size_t ndigits)</td></tr>
<tr class="memdesc:ae3ecf0ae65f624c972903c0961863428"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if a == b, else false (quick)  <a href="#ae3ecf0ae65f624c972903c0961863428">More...</a><br/></td></tr>
<tr class="separator:ae3ecf0ae65f624c972903c0961863428"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e5d6a0e98281e52883da702ea151597"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a7e5d6a0e98281e52883da702ea151597">mpCompare_q</a> (const u32 a[], const u32 b[], size_t ndigits)</td></tr>
<tr class="memdesc:a7e5d6a0e98281e52883da702ea151597"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns sign of <code>(a-b)</code> as <code>{-1,0,+1}</code> (quick)  <a href="#a7e5d6a0e98281e52883da702ea151597">More...</a><br/></td></tr>
<tr class="separator:a7e5d6a0e98281e52883da702ea151597"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a530cb494f383cbc7b0938f1e75c4c824"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a530cb494f383cbc7b0938f1e75c4c824">mpIsZero_q</a> (const u32 a[], size_t ndigits)</td></tr>
<tr class="memdesc:a530cb494f383cbc7b0938f1e75c4c824"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if a is zero, else false (quick)  <a href="#a530cb494f383cbc7b0938f1e75c4c824">More...</a><br/></td></tr>
<tr class="separator:a530cb494f383cbc7b0938f1e75c4c824"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ca7d847e83c72e810774d3c8faf3d42"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a4ca7d847e83c72e810774d3c8faf3d42">mpModExp</a> (u32 y[], const u32 x[], const u32 e[], u32 m[], size_t ndigits)</td></tr>
<tr class="memdesc:a4ca7d847e83c72e810774d3c8faf3d42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes y = x^e mod m.  <a href="#a4ca7d847e83c72e810774d3c8faf3d42">More...</a><br/></td></tr>
<tr class="separator:a4ca7d847e83c72e810774d3c8faf3d42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81f43e382a5babc239c97b076fe7829b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a81f43e382a5babc239c97b076fe7829b">mpModExp_ct</a> (u32 yout[], const u32 x[], const u32 e[], u32 m[], size_t ndigits)</td></tr>
<tr class="memdesc:a81f43e382a5babc239c97b076fe7829b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes y = x^e mod m in constant time.  <a href="#a81f43e382a5babc239c97b076fe7829b">More...</a><br/></td></tr>
<tr class="separator:a81f43e382a5babc239c97b076fe7829b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab38130bb56dec16ad7ee185182e689e0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ab38130bb56dec16ad7ee185182e689e0">mpModMult</a> (u32 a[], const u32 x[], const u32 y[], u32 m[], size_t ndigits)</td></tr>
<tr class="memdesc:ab38130bb56dec16ad7ee185182e689e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes a = (x * y) mod m.  <a href="#ab38130bb56dec16ad7ee185182e689e0">More...</a><br/></td></tr>
<tr class="separator:ab38130bb56dec16ad7ee185182e689e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a644f6447391ea04fdb9ba7f8b5d78de7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv</a> (u32 inv[], const u32 u[], const u32 m[], size_t ndigits)</td></tr>
<tr class="memdesc:a644f6447391ea04fdb9ba7f8b5d78de7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the inverse of <code>u</code> modulo <code>m</code>, inv = u^{-1} mod m.  <a href="#a644f6447391ea04fdb9ba7f8b5d78de7">More...</a><br/></td></tr>
<tr class="separator:a644f6447391ea04fdb9ba7f8b5d78de7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0571c6d22df02f1d06ad35d85df6f67"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd</a> (u32 g[], const u32 x[], const u32 y[], size_t ndigits)</td></tr>
<tr class="memdesc:ae0571c6d22df02f1d06ad35d85df6f67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes g = gcd(x, y), the greatest common divisor of x and y.  <a href="#ae0571c6d22df02f1d06ad35d85df6f67">More...</a><br/></td></tr>
<tr class="separator:ae0571c6d22df02f1d06ad35d85df6f67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32626062a7c127eed845c799c2176c38"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi</a> (const u32 a[], const u32 n[], size_t ndigits)</td></tr>
<tr class="memdesc:a32626062a7c127eed845c799c2176c38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the Jacobi symbol (a/n) in {-1, 0, +1}.  <a href="#a32626062a7c127eed845c799c2176c38">More...</a><br/></td></tr>
<tr class="separator:a32626062a7c127eed845c799c2176c38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a73f82be10b0ca4c8a7e51c52bad262"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a1a73f82be10b0ca4c8a7e51c52bad262">mpBitLength</a> (const u32 a[], size_t ndigits)</td></tr>
<tr class="memdesc:a1a73f82be10b0ca4c8a7e51c52bad262"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns number of significant bits in a.  <a href="#a1a73f82be10b0ca4c8a7e51c52bad262">More...</a><br/></td></tr>
<tr class="separator:a1a73f82be10b0ca4c8a7e51c52bad262"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6837bac786e6c592602feb8a37c52d5"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#af6837bac786e6c592602feb8a37c52d5">mpShiftLeft</a> (u32 a[], const u32 b[], size_t x, size_t ndigits)</td></tr>
<tr class="memdesc:af6837bac786e6c592602feb8a37c52d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes a = b &lt;&lt; x.  <a href="#af6837bac786e6c592602feb8a37c52d5">More...</a><br/></td></tr>
<tr class="separator:af6837bac786e6c592602feb8a37c52d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaab56ae575c4e3bc18d5a89df21c53f7"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#aaab56ae575c4e3bc18d5a89df21c53f7">mpShiftRight</a> (u32 a[], const u32 b[], size_t x, size_t ndigits)</td></tr>
<tr class="memdesc:aaab56ae575c4e3bc18d5a89df21c53f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes a = b &gt;&gt; x.  <a href="#aaab56ae575c4e3bc18d5a89df21c53f7">More...</a><br/></td></tr>
<tr class="separator:aaab56ae575c4e3bc18d5a89df21c53f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8518e5f683a939df4e2e9f97ae51b2b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ae8518e5f683a939df4e2e9f97ae51b2b">mpXorBits</a> (u32 a[], const u32 b[], const u32 c[], size_t ndigits)</td></tr>
<tr class="memdesc:ae8518e5f683a939df4e2e9f97ae51b2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes bitwise a = b XOR c.  <a href="#ae8518e5f683a939df4e2e9f97ae51b2b">More...</a><br/></td></tr>
<tr class="separator:ae8518e5f683a939df4e2e9f97ae51b2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94209753b2498a21d8be57b0d9f8a205"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a94209753b2498a21d8be57b0d9f8a205">mpOrBits</a> (u32 a[], const u32 b[], const u32 c[], size_t ndigits)</td></tr>
<tr class="memdesc:a94209753b2498a21d8be57b0d9f8a205"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes bitwise a = b OR c.  <a href="#a94209753b2498a21d8be57b0d9f8a205">More...</a><br/></td></tr>
<tr class="separator:a94209753b2498a21d8be57b0d9f8a205"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f880cfbf3bc582f54ac675df8bd6b22"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a3f880cfbf3bc582f54ac675df8bd6b22">mpAndBits</a> (u32 a[], const u32 b[], const u32 c[], size_t ndigits)</td></tr>
<tr class="memdesc:a3f880cfbf3bc582f54ac675df8bd6b22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes bitwise a = b AND c.  <a href="#a3f880cfbf3bc582f54ac675df8bd6b22">More...</a><br/></td></tr>
<tr class="separator:a3f880cfbf3bc582f54ac675df8bd6b22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45d11ad9b80ea9993d429bae4d4e3c51"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a45d11ad9b80ea9993d429bae4d4e3c51">mpNotBits</a> (u32 a[], const u32 b[], size_t ndigits)</td></tr>
<tr class="memdesc:a45d11ad9b80ea9993d429bae4d4e3c51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes bitwise a = NOT b.  <a href="#a45d11ad9b80ea9993d429bae4d4e3c51">More...</a><br/></td></tr>
<tr class="separator:a45d11ad9b80ea9993d429bae4d4e3c51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9a5dfe293ccd4f86979bb207bcdc457"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ab9a5dfe293ccd4f86979bb207bcdc457">mpModPowerOf2</a> (u32 a[], size_t ndigits, size_t L)</td></tr>
<tr class="memdesc:ab9a5dfe293ccd4f86979bb207bcdc457"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes a = a mod 2^L, ie clears all bits greater than L.  <a href="#ab9a5dfe293ccd4f86979bb207bcdc457">More...</a><br/></td></tr>
<tr class="separator:ab9a5dfe293ccd4f86979bb207bcdc457"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a446a5ab32deeb02277479dff4953e13e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a446a5ab32deeb02277479dff4953e13e">mpSetBit</a> (u32 a[], size_t ndigits, size_t n, int value)</td></tr>
<tr class="memdesc:a446a5ab32deeb02277479dff4953e13e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets bit n of a (0..nbits-1) with value 1 or 0.  <a href="#a446a5ab32deeb02277479dff4953e13e">More...</a><br/></td></tr>
<tr class="separator:a446a5ab32deeb02277479dff4953e13e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab62a26b7b7bc001f81a650f4b382df0a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ab62a26b7b7bc001f81a650f4b382df0a">mpGetBit</a> (u32 a[], size_t ndigits, size_t n)</td></tr>
<tr class="memdesc:ab62a26b7b7bc001f81a650f4b382df0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns value 1 or 0 of bit n (0..nbits-1)  <a href="#ab62a26b7b7bc001f81a650f4b382df0a">More...</a><br/></td></tr>
<tr class="separator:ab62a26b7b7bc001f81a650f4b382df0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a32c0a32ee38fd15afb14cccc5601d9"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a0a32c0a32ee38fd15afb14cccc5601d9">mpSetZero</a> (u32 a[], size_t ndigits)</td></tr>
<tr class="memdesc:a0a32c0a32ee38fd15afb14cccc5601d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a = 0.  <a href="#a0a32c0a32ee38fd15afb14cccc5601d9">More...</a><br/></td></tr>
<tr class="separator:a0a32c0a32ee38fd15afb14cccc5601d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe97063d506389797a9647a8803edc65"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#afe97063d506389797a9647a8803edc65">mpSetDigit</a> (u32 a[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:afe97063d506389797a9647a8803edc65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a = d where d is a single digit.  <a href="#afe97063d506389797a9647a8803edc65">More...</a><br/></td></tr>
<tr class="separator:afe97063d506389797a9647a8803edc65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa40ded0449ebaf383877100804197948"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual</a> (u32 a[], const u32 b[], size_t ndigits)</td></tr>
<tr class="memdesc:aa40ded0449ebaf383877100804197948"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a = b.  <a href="#aa40ded0449ebaf383877100804197948">More...</a><br/></td></tr>
<tr class="separator:aa40ded0449ebaf383877100804197948"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89d8fb72ea0b381ce9099b09901cec10"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a89d8fb72ea0b381ce9099b09901cec10">mpSizeof</a> (const u32 a[], size_t ndigits)</td></tr>
<tr class="memdesc:a89d8fb72ea0b381ce9099b09901cec10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns number of significant non-zero digits in a.  <a href="#a89d8fb72ea0b381ce9099b09901cec10">More...</a><br/></td></tr>
<tr class="separator:a89d8fb72ea0b381ce9099b09901cec10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afee0546db3e24c672b9bc35fbe3d24ca"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#afee0546db3e24c672b9bc35fbe3d24ca">mpIsPrime</a> (u32 w[], size_t ndigits, size_t t)</td></tr>
<tr class="memdesc:afee0546db3e24c672b9bc35fbe3d24ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true (1) if <code>w</code> is probably prime.  <a href="#afee0546db3e24c672b9bc35fbe3d24ca">More...</a><br/></td></tr>
<tr class="separator:afee0546db3e24c672b9bc35fbe3d24ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a153f831f4e86caa9d90109df71b15b45"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller</a> (u32 w[], size_t ndigits, size_t t)</td></tr>
<tr class="memdesc:a153f831f4e86caa9d90109df71b15b45"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true (1) if <code>w</code> is probably prime using just the Rabin-Miller test.  <a href="#a153f831f4e86caa9d90109df71b15b45">More...</a><br/></td></tr>
<tr class="separator:a153f831f4e86caa9d90109df71b15b45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6970367c69eee9ed5c65e140b067cf3"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ad6970367c69eee9ed5c65e140b067cf3">mpShortAdd</a> (u32 w[], const u32 u[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:ad6970367c69eee9ed5c65e140b067cf3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes w = u + d, returns carry.  <a href="#ad6970367c69eee9ed5c65e140b067cf3">More...</a><br/></td></tr>
<tr class="separator:ad6970367c69eee9ed5c65e140b067cf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf60cb91d9bf64b9ab8cd6c7995a2c6f"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#acf60cb91d9bf64b9ab8cd6c7995a2c6f">mpShortSub</a> (u32 w[], const u32 u[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:acf60cb91d9bf64b9ab8cd6c7995a2c6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes w = u - d, returns borrow.  <a href="#acf60cb91d9bf64b9ab8cd6c7995a2c6f">More...</a><br/></td></tr>
<tr class="separator:acf60cb91d9bf64b9ab8cd6c7995a2c6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86a47b90849a08b00a9030d3ca076144"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a86a47b90849a08b00a9030d3ca076144">mpShortMult</a> (u32 p[], const u32 x[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:a86a47b90849a08b00a9030d3ca076144"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes product p = x * d.  <a href="#a86a47b90849a08b00a9030d3ca076144">More...</a><br/></td></tr>
<tr class="separator:a86a47b90849a08b00a9030d3ca076144"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2057382ebab06472fed38f5b71399f6a"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a2057382ebab06472fed38f5b71399f6a">mpShortDiv</a> (u32 q[], const u32 u[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:a2057382ebab06472fed38f5b71399f6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes quotient q = u div d, returns remainder.  <a href="#a2057382ebab06472fed38f5b71399f6a">More...</a><br/></td></tr>
<tr class="separator:a2057382ebab06472fed38f5b71399f6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa248383631135e0a8504d2bd569fbce2"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#aa248383631135e0a8504d2bd569fbce2">mpShortMod</a> (const u32 a[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:aa248383631135e0a8504d2bd569fbce2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes remainder r = a mod d.  <a href="#aa248383631135e0a8504d2bd569fbce2">More...</a><br/></td></tr>
<tr class="separator:aa248383631135e0a8504d2bd569fbce2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54a5d832ff76748576c7447d7eeb8e7d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp</a> (const u32 a[], u32 d, size_t ndigits)</td></tr>
<tr class="memdesc:a54a5d832ff76748576c7447d7eeb8e7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns sign of (a - d) where d is a single digit.  <a href="#a54a5d832ff76748576c7447d7eeb8e7d">More...</a><br/></td></tr>
<tr class="separator:a54a5d832ff76748576c7447d7eeb8e7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8479a1c0578e65b051674817c5bd77b9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a8479a1c0578e65b051674817c5bd77b9">spMultiply</a> (u32 p[2], u32 x, u32 y)</td></tr>
<tr class="memdesc:a8479a1c0578e65b051674817c5bd77b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes p = x * y, where x and y are single digits.  <a href="#a8479a1c0578e65b051674817c5bd77b9">More...</a><br/></td></tr>
<tr class="separator:a8479a1c0578e65b051674817c5bd77b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bdaee33308ee8393ba8bae4fe8f4220"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a3bdaee33308ee8393ba8bae4fe8f4220">spDivide</a> (u32 *q, u32 *r, const u32 u[2], u32 v)</td></tr>
<tr class="memdesc:a3bdaee33308ee8393ba8bae4fe8f4220"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes quotient q = u div v, remainder r = u mod v, where q, r and v are single digits.  <a href="#a3bdaee33308ee8393ba8bae4fe8f4220">More...</a><br/></td></tr>
<tr class="separator:a3bdaee33308ee8393ba8bae4fe8f4220"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7e9dd871ac50a08b8ccae4592ba120e"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ad7e9dd871ac50a08b8ccae4592ba120e">spSimpleRand</a> (u32 lower, u32 upper)</td></tr>
<tr class="memdesc:ad7e9dd871ac50a08b8ccae4592ba120e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a simple pseudo-random digit between lower and upper.  <a href="#ad7e9dd871ac50a08b8ccae4592ba120e">More...</a><br/></td></tr>
<tr class="separator:ad7e9dd871ac50a08b8ccae4592ba120e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3df35cea910a1b2ddd4a0f909b11fe5e"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a3df35cea910a1b2ddd4a0f909b11fe5e">mpQuickRandBits</a> (u32 a[], size_t ndigits, size_t nbits)</td></tr>
<tr class="memdesc:a3df35cea910a1b2ddd4a0f909b11fe5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a quick-and-dirty random mp number a of bit length at most <code>nbits</code> using plain-old-rand.  <a href="#a3df35cea910a1b2ddd4a0f909b11fe5e">More...</a><br/></td></tr>
<tr class="separator:a3df35cea910a1b2ddd4a0f909b11fe5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65d767d47344f3c1f25e8e40f033d800"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a65d767d47344f3c1f25e8e40f033d800">mpPrintHex</a> (const char *prefix, const u32 *p, size_t ndigits, const char *suffix)</td></tr>
<tr class="memdesc:a65d767d47344f3c1f25e8e40f033d800"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print in hex format with optional prefix and suffix strings.  <a href="#a65d767d47344f3c1f25e8e40f033d800">More...</a><br/></td></tr>
<tr class="separator:a65d767d47344f3c1f25e8e40f033d800"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac466319fe455605d132019da44c042a3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ac466319fe455605d132019da44c042a3">mpPrint</a> (const u32 *p, size_t ndigits)</td></tr>
<tr class="memdesc:ac466319fe455605d132019da44c042a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print in decimal format with optional prefix and suffix strings.  <a href="#ac466319fe455605d132019da44c042a3">More...</a><br/></td></tr>
<tr class="separator:ac466319fe455605d132019da44c042a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11fb08a4b901049e10a6bd5e769f8d90"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a11fb08a4b901049e10a6bd5e769f8d90">mpPrintNL</a> (const u32 *p, size_t ndigits)</td></tr>
<tr class="memdesc:a11fb08a4b901049e10a6bd5e769f8d90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print all digits in hex with newlines.  <a href="#a11fb08a4b901049e10a6bd5e769f8d90">More...</a><br/></td></tr>
<tr class="separator:a11fb08a4b901049e10a6bd5e769f8d90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bbb54139efc28eba4a5299a94d31258"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a9bbb54139efc28eba4a5299a94d31258">mpPrintTrim</a> (const u32 *p, size_t ndigits)</td></tr>
<tr class="memdesc:a9bbb54139efc28eba4a5299a94d31258"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print in hex but trim leading zero digits.  <a href="#a9bbb54139efc28eba4a5299a94d31258">More...</a><br/></td></tr>
<tr class="separator:a9bbb54139efc28eba4a5299a94d31258"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a302c68abf9fd95006d1a2b56f1515bac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a302c68abf9fd95006d1a2b56f1515bac">mpPrintTrimNL</a> (const u32 *p, size_t ndigits)</td></tr>
<tr class="memdesc:a302c68abf9fd95006d1a2b56f1515bac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print in hex, trim leading zeroes, add newlines.  <a href="#a302c68abf9fd95006d1a2b56f1515bac">More...</a><br/></td></tr>
<tr class="separator:a302c68abf9fd95006d1a2b56f1515bac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af17b0b6a122dad76d5c447f0e5979535"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#af17b0b6a122dad76d5c447f0e5979535">mpConvFromOctets</a> (u32 a[], size_t ndigits, const unsigned char *c, size_t nbytes)</td></tr>
<tr class="memdesc:af17b0b6a122dad76d5c447f0e5979535"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts nbytes octets into big digit a of max size ndigits.  <a href="#af17b0b6a122dad76d5c447f0e5979535">More...</a><br/></td></tr>
<tr class="separator:af17b0b6a122dad76d5c447f0e5979535"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac059684115bb5942c2633d99ec41d149"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#ac059684115bb5942c2633d99ec41d149">mpConvToOctets</a> (const u32 a[], size_t ndigits, unsigned char *c, size_t nbytes)</td></tr>
<tr class="memdesc:ac059684115bb5942c2633d99ec41d149"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts big digit a into string of octets, in big-endian order, padding to nbytes or truncating if necessary.  <a href="#ac059684115bb5942c2633d99ec41d149">More...</a><br/></td></tr>
<tr class="separator:ac059684115bb5942c2633d99ec41d149"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7aceff23b773fe9cca62ef91db0e30ab"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a7aceff23b773fe9cca62ef91db0e30ab">mpIsNegative</a> (const u32 x[], size_t ndigits)</td></tr>
<tr class="memdesc:a7aceff23b773fe9cca62ef91db0e30ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true (1) if x &lt; 0, else false (0)  <a href="#a7aceff23b773fe9cca62ef91db0e30ab">More...</a><br/></td></tr>
<tr class="separator:a7aceff23b773fe9cca62ef91db0e30ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8666a8cd063b0aeb53956f14edd219ff"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a8666a8cd063b0aeb53956f14edd219ff">mpChs</a> (u32 x[], const u32 y[], size_t ndigits)</td></tr>
<tr class="memdesc:a8666a8cd063b0aeb53956f14edd219ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets x = -y.  <a href="#a8666a8cd063b0aeb53956f14edd219ff">More...</a><br/></td></tr>
<tr class="separator:a8666a8cd063b0aeb53956f14edd219ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bcb8a0e0ed0e1fbfac8fd507c75bc1a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a4bcb8a0e0ed0e1fbfac8fd507c75bc1a">mpAbs</a> (u32 x[], const u32 y[], size_t ndigits)</td></tr>
<tr class="memdesc:a4bcb8a0e0ed0e1fbfac8fd507c75bc1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets x = |y|, the absolute value of y.  <a href="#a4bcb8a0e0ed0e1fbfac8fd507c75bc1a">More...</a><br/></td></tr>
<tr class="separator:a4bcb8a0e0ed0e1fbfac8fd507c75bc1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5593505351c9c1938ad52404c8f9a44c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bigdigits_8h.html#a5593505351c9c1938ad52404c8f9a44c">mpVersion</a> (void)</td></tr>
<tr class="memdesc:a5593505351c9c1938ad52404c8f9a44c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns version number = major*1000+minor*100+release*10+PP_OPTIONS.  <a href="#a5593505351c9c1938ad52404c8f9a44c">More...</a><br/></td></tr>
<tr class="separator:a5593505351c9c1938ad52404c8f9a44c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ab56c606f91a4f8d105bbf3bbe0640b6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef uint32_t <a class="el" href="bigdigits_8h.html#ab56c606f91a4f8d105bbf3bbe0640b6c">DIGIT_T</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The basic BigDigit element, an unsigned 32-bit integer. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a4bcb8a0e0ed0e1fbfac8fd507c75bc1a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpAbs </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>y</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets x = |y|, the absolute value of y. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Expects a negative number to be stored in two's-complement representation.</dd></dl>
<p>Sets x = |y|, the absolute value of y. </p>

<p>References <a class="el" href="bigdigits_8h.html#a8666a8cd063b0aeb53956f14edd219ff">mpChs()</a>, <a class="el" href="bigdigits_8h.html#a7aceff23b773fe9cca62ef91db0e30ab">mpIsNegative()</a>, and <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>.</p>

</div>
</div>
<a class="anchor" id="a77bf097cd0692608f06b524ff1ef04db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpAdd </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>v</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes w = u + v, returns carry. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, and <a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt()</a>.</p>

</div>
</div>
<a class="anchor" id="a3f880cfbf3bc582f54ac675df8bd6b22"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpAndBits </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>c</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes bitwise a = b AND c. </p>

</div>
</div>
<a class="anchor" id="a1a73f82be10b0ca4c8a7e51c52bad262"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t mpBitLength </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns number of significant bits in a. </p>

<p>References <a class="el" href="bigdigits_8h.html#a89d8fb72ea0b381ce9099b09901cec10">mpSizeof()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#ac059684115bb5942c2633d99ec41d149">mpConvToOctets()</a>.</p>

</div>
</div>
<a class="anchor" id="a8666a8cd063b0aeb53956f14edd219ff"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpChs </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>y</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets x = -y. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Expects a negative number to be stored in two's-complement representation. </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a7aceff23b773fe9cca62ef91db0e30ab">mpIsNegative()</a>, <a class="el" href="bigdigits_8h.html#a45d11ad9b80ea9993d429bae4d4e3c51">mpNotBits()</a>, <a class="el" href="bigdigits_8h.html#ad6970367c69eee9ed5c65e140b067cf3">mpShortAdd()</a>, and <a class="el" href="bigdigits_8h.html#acf60cb91d9bf64b9ab8cd6c7995a2c6f">mpShortSub()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a4bcb8a0e0ed0e1fbfac8fd507c75bc1a">mpAbs()</a>.</p>

</div>
</div>
<a class="anchor" id="a4688fa13c48155ed2cfc18ebef0e838f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpCompare </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns sign of <code>(a-b)</code> as <code>{-1,0,+1}</code> using constant-time algorithm. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Constant-time with respect to <code>ndigits</code></dd></dl>
<p>Returns sign of <code>(a-b)</code> as <code>{-1,0,+1}</code> using constant-time algorithm. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>, and <a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt()</a>.</p>

</div>
</div>
<a class="anchor" id="a7e5d6a0e98281e52883da702ea151597"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpCompare_q </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns sign of <code>(a-b)</code> as <code>{-1,0,+1}</code> (quick) </p>
<dl class="section remark"><dt>Remarks</dt><dd>Not constant-time.</dd></dl>
<p>Returns sign of <code>(a-b)</code> as <code>{-1,0,+1}</code> (quick)</p>
<p>Not constant-time. </p>

</div>
</div>
<a class="anchor" id="af17b0b6a122dad76d5c447f0e5979535"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t mpConvFromOctets </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts nbytes octets into big digit a of max size ndigits. </p>
<dl class="section return"><dt>Returns</dt><dd>actual number of digits set </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a0a32c0a32ee38fd15afb14cccc5601d9">mpSetZero()</a>.</p>

</div>
</div>
<a class="anchor" id="ac059684115bb5942c2633d99ec41d149"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t mpConvToOctets </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts big digit a into string of octets, in big-endian order, padding to nbytes or truncating if necessary. </p>
<dl class="section return"><dt>Returns</dt><dd>number of non-zero octets required. </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a1a73f82be10b0ca4c8a7e51c52bad262">mpBitLength()</a>.</p>

</div>
</div>
<a class="anchor" id="a453714cb1ce75fc02fceceaf8b35a75a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpCubeRoot </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>s</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes integer cube root s = floor(cuberoot(x)) </p>

<p>References <a class="el" href="bigdigits_8h.html#a77bf097cd0692608f06b524ff1ef04db">mpAdd()</a>, <a class="el" href="bigdigits_8h.html#a4688fa13c48155ed2cfc18ebef0e838f">mpCompare()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp()</a>, and <a class="el" href="bigdigits_8h.html#a2057382ebab06472fed38f5b71399f6a">mpShortDiv()</a>.</p>

</div>
</div>
<a class="anchor" id="a2a9beba8b1b46a0f415197f512dff569"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpDivide </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>q</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>r</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>udigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>v</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>vdigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes integer division of u by v such that u=qv+r. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">q</td><td>to receive quotient = u div v, an array of size <code>udigits</code> </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>to receive divisor = u mod v, an array of size <code>udigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u</td><td>dividend of size <code>udigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">udigits</td><td>size of arrays <code>q</code> <code>r</code> and <code>u</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>divisor of size <code>vdigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">vdigits</td><td>size of array <code>v</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Trashes q and r first </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a77bf097cd0692608f06b524ff1ef04db">mpAdd()</a>, <a class="el" href="bigdigits_8h.html#a4688fa13c48155ed2cfc18ebef0e838f">mpCompare()</a>, <a class="el" href="bigdigits_8h.html#afe97063d506389797a9647a8803edc65">mpSetDigit()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#a0a32c0a32ee38fd15afb14cccc5601d9">mpSetZero()</a>, <a class="el" href="bigdigits_8h.html#af6837bac786e6c592602feb8a37c52d5">mpShiftLeft()</a>, <a class="el" href="bigdigits_8h.html#aaab56ae575c4e3bc18d5a89df21c53f7">mpShiftRight()</a>, <a class="el" href="bigdigits_8h.html#a2057382ebab06472fed38f5b71399f6a">mpShortDiv()</a>, <a class="el" href="bigdigits_8h.html#a89d8fb72ea0b381ce9099b09901cec10">mpSizeof()</a>, and <a class="el" href="bigdigits_8h.html#a3bdaee33308ee8393ba8bae4fe8f4220">spDivide()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot()</a>, <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, <a class="el" href="bigdigits_8h.html#a8e3034074cb07fb9b9764d3448c03ab6">mpModulo()</a>, and <a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt()</a>.</p>

</div>
</div>
<a class="anchor" id="a934236a4337de87363660bc227aece52"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpEqual </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if a == b, else false, using constant-time algorithm. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Constant-time with respect to <code>ndigits</code></dd></dl>
<p>Returns true if a == b, else false, using constant-time algorithm. </p>

</div>
</div>
<a class="anchor" id="ae3ecf0ae65f624c972903c0961863428"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpEqual_q </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if a == b, else false (quick) </p>
<dl class="section remark"><dt>Remarks</dt><dd>Not constant-time.</dd></dl>
<p>Returns true if a == b, else false (quick)</p>
<p>Not constant-time. </p>

</div>
</div>
<a class="anchor" id="ae0571c6d22df02f1d06ad35d85df6f67"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpGcd </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>g</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>y</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes g = gcd(x, y), the greatest common divisor of x and y. </p>

<p>References <a class="el" href="bigdigits_8h.html#a4688fa13c48155ed2cfc18ebef0e838f">mpCompare()</a>, <a class="el" href="bigdigits_8h.html#a328c19b60c24beb9f1f3a6b8cf341aa2">mpIsZero()</a>, <a class="el" href="bigdigits_8h.html#a8e3034074cb07fb9b9764d3448c03ab6">mpModulo()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#af6837bac786e6c592602feb8a37c52d5">mpShiftLeft()</a>, <a class="el" href="bigdigits_8h.html#aaab56ae575c4e3bc18d5a89df21c53f7">mpShiftRight()</a>, and <a class="el" href="bigdigits_8h.html#aa160f8403c9e4e296c4cfe1afa98f5d7">mpSubtract()</a>.</p>

</div>
</div>
<a class="anchor" id="ab62a26b7b7bc001f81a650f4b382df0a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpGetBit </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns value 1 or 0 of bit n (0..nbits-1) </p>

</div>
</div>
<a class="anchor" id="a7aceff23b773fe9cca62ef91db0e30ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpIsNegative </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true (1) if x &lt; 0, else false (0) </p>
<dl class="section remark"><dt>Remarks</dt><dd>Expects a negative number to be stored in two's-complement representation.</dd></dl>
<p>Returns true (1) if x &lt; 0, else false (0) </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a4bcb8a0e0ed0e1fbfac8fd507c75bc1a">mpAbs()</a>, and <a class="el" href="bigdigits_8h.html#a8666a8cd063b0aeb53956f14edd219ff">mpChs()</a>.</p>

</div>
</div>
<a class="anchor" id="afee0546db3e24c672b9bc35fbe3d24ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpIsPrime </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true (1) if <code>w</code> is probably prime. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">w</td><td>Number to test </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">ndigits</td><td>size of array <code>w</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>The count of Rabin-Miller primality tests to carry out (recommended at least 80) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true (1) if w is probably prime otherwise false (0) </dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>Uses FIPS-186-2/Rabin-Miller with trial division by small primes, which is faster in most cases than <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45" title="Returns true (1) if w is probably prime using just the Rabin-Miller test. ">mpRabinMiller()</a>. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45" title="Returns true (1) if w is probably prime using just the Rabin-Miller test. ">mpRabinMiller()</a>. </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>, <a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp()</a>, and <a class="el" href="bigdigits_8h.html#aa248383631135e0a8504d2bd569fbce2">mpShortMod()</a>.</p>

</div>
</div>
<a class="anchor" id="a328c19b60c24beb9f1f3a6b8cf341aa2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpIsZero </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if a is zero, else false, using constant-time algorithm. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Constant-time with respect to <code>ndigits</code></dd></dl>
<p>Returns true if a is zero, else false, using constant-time algorithm. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, <a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi()</a>, <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, and <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="a530cb494f383cbc7b0938f1e75c4c824"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpIsZero_q </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if a is zero, else false (quick) </p>
<dl class="section remark"><dt>Remarks</dt><dd>Not constant-time.</dd></dl>
<p>Returns true if a is zero, else false (quick)</p>
<p>Not constant-time. </p>

</div>
</div>
<a class="anchor" id="a32626062a7c127eed845c799c2176c38"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpJacobi </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>n</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the Jacobi symbol (a/n) in {-1, 0, +1}. </p>
<dl class="section remark"><dt>Remarks</dt><dd>If n is prime then the Jacobi symbol becomes the Legendre symbol (a/p) defined to be<ul>
<li>(a/p) = +1 if a is a quadratic residue modulo p</li>
<li>(a/p) = -1 if a is a quadratic non-residue modulo p</li>
<li>(a/p) = 0 if a is divisible by p </li>
</ul>
</dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a328c19b60c24beb9f1f3a6b8cf341aa2">mpIsZero()</a>, <a class="el" href="bigdigits_8h.html#a8e3034074cb07fb9b9764d3448c03ab6">mpModulo()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#aaab56ae575c4e3bc18d5a89df21c53f7">mpShiftRight()</a>, <a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp()</a>, and <a class="el" href="bigdigits_8h.html#aa248383631135e0a8504d2bd569fbce2">mpShortMod()</a>.</p>

</div>
</div>
<a class="anchor" id="a4ca7d847e83c72e810774d3c8faf3d42"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpModExp </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>y</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>e</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>m</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes y = x^e mod m. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="a81f43e382a5babc239c97b076fe7829b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpModExp_ct </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>yout</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>e</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>m</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes y = x^e mod m in constant time. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Resistant to simple power analysis attack on private exponent. Slower than <a class="el" href="bigdigits_8h.html#a4ca7d847e83c72e810774d3c8faf3d42" title="Computes y = x^e mod m. ">mpModExp()</a>.</dd></dl>
<p>Computes y = x^e mod m in constant time. </p>

<p>References <a class="el" href="bigdigits_8h.html#afe97063d506389797a9647a8803edc65">mpSetDigit()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, and <a class="el" href="bigdigits_8h.html#a89d8fb72ea0b381ce9099b09901cec10">mpSizeof()</a>.</p>

</div>
</div>
<a class="anchor" id="a644f6447391ea04fdb9ba7f8b5d78de7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpModInv </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>inv</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>m</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes the inverse of <code>u</code> modulo <code>m</code>, inv = u^{-1} mod m. </p>

<p>References <a class="el" href="bigdigits_8h.html#a77bf097cd0692608f06b524ff1ef04db">mpAdd()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#a328c19b60c24beb9f1f3a6b8cf341aa2">mpIsZero()</a>, <a class="el" href="bigdigits_8h.html#aa57007f55945e5caad5fa4e4da0ab2ec">mpMultiply()</a>, <a class="el" href="bigdigits_8h.html#afe97063d506389797a9647a8803edc65">mpSetDigit()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#a0a32c0a32ee38fd15afb14cccc5601d9">mpSetZero()</a>, <a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp()</a>, and <a class="el" href="bigdigits_8h.html#aa160f8403c9e4e296c4cfe1afa98f5d7">mpSubtract()</a>.</p>

</div>
</div>
<a class="anchor" id="ab38130bb56dec16ad7ee185182e689e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpModMult </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>y</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>m</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes a = (x * y) mod m. </p>

<p>References <a class="el" href="bigdigits_8h.html#a8e3034074cb07fb9b9764d3448c03ab6">mpModulo()</a>, and <a class="el" href="bigdigits_8h.html#aa57007f55945e5caad5fa4e4da0ab2ec">mpMultiply()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="ab9a5dfe293ccd4f86979bb207bcdc457"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpModPowerOf2 </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>L</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes a = a mod 2^L, ie clears all bits greater than L. </p>

</div>
</div>
<a class="anchor" id="a8e3034074cb07fb9b9764d3448c03ab6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpModulo </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>r</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>udigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>v</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>vdigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes remainder r = u mod v. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>to receive divisor = u mod v, an array of size <code>vdigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u</td><td>dividend of size <code>udigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">udigits</td><td>size of arrays <code>r</code> and <code>u</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>divisor of size <code>vdigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">vdigits</td><td>size of array <code>v</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section remark"><dt>Remarks</dt><dd>Note that <code>r</code> is <code>vdigits</code> long here, but is <code>udigits</code> long in <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569" title="Computes integer division of u by v such that u=qv+r. ">mpDivide()</a>. </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, and <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, <a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi()</a>, and <a class="el" href="bigdigits_8h.html#ab38130bb56dec16ad7ee185182e689e0">mpModMult()</a>.</p>

</div>
</div>
<a class="anchor" id="aa57007f55945e5caad5fa4e4da0ab2ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpMultiply </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>v</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes product w = u * v. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">w</td><td>To receive the product, an array of size 2 x <code>ndigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u</td><td>An array of size <code>ndigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">v</td><td>An array of size <code>ndigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">ndigits</td><td>size of arrays <code>u</code> and <code>v</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>The product must be of size 2 x <code>ndigits</code> </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a8479a1c0578e65b051674817c5bd77b9">spMultiply()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, and <a class="el" href="bigdigits_8h.html#ab38130bb56dec16ad7ee185182e689e0">mpModMult()</a>.</p>

</div>
</div>
<a class="anchor" id="a45d11ad9b80ea9993d429bae4d4e3c51"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpNotBits </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes bitwise a = NOT b. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a8666a8cd063b0aeb53956f14edd219ff">mpChs()</a>.</p>

</div>
</div>
<a class="anchor" id="a94209753b2498a21d8be57b0d9f8a205"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpOrBits </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>c</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes bitwise a = b OR c. </p>

</div>
</div>
<a class="anchor" id="ac466319fe455605d132019da44c042a3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpPrint </td>
          <td>(</td>
          <td class="paramtype">const u32 *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print in decimal format with optional prefix and suffix strings. </p>
<p>Print all digits in hex incl leading zero digits </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a9bbb54139efc28eba4a5299a94d31258">mpPrintTrim()</a>.</p>

</div>
</div>
<a class="anchor" id="a65d767d47344f3c1f25e8e40f033d800"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpPrintHex </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>prefix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32 *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>suffix</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print in hex format with optional prefix and suffix strings. </p>

</div>
</div>
<a class="anchor" id="a11fb08a4b901049e10a6bd5e769f8d90"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpPrintNL </td>
          <td>(</td>
          <td class="paramtype">const u32 *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print all digits in hex with newlines. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a302c68abf9fd95006d1a2b56f1515bac">mpPrintTrimNL()</a>.</p>

</div>
</div>
<a class="anchor" id="a9bbb54139efc28eba4a5299a94d31258"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpPrintTrim </td>
          <td>(</td>
          <td class="paramtype">const u32 *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print in hex but trim leading zero digits. </p>

<p>References <a class="el" href="bigdigits_8h.html#ac466319fe455605d132019da44c042a3">mpPrint()</a>.</p>

</div>
</div>
<a class="anchor" id="a302c68abf9fd95006d1a2b56f1515bac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpPrintTrimNL </td>
          <td>(</td>
          <td class="paramtype">const u32 *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print in hex, trim leading zeroes, add newlines. </p>

<p>References <a class="el" href="bigdigits_8h.html#a11fb08a4b901049e10a6bd5e769f8d90">mpPrintNL()</a>.</p>

</div>
</div>
<a class="anchor" id="a3df35cea910a1b2ddd4a0f909b11fe5e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t mpQuickRandBits </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>nbits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generate a quick-and-dirty random mp number a of bit length at most <code>nbits</code> using plain-old-rand. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Not crypto secure. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd>mpRandomBits()</dd></dl>
<p>Generate a quick-and-dirty random mp number a of bit length at most <code>nbits</code> using plain-old-rand. </p>

<p>References <a class="el" href="bigdigits_8h.html#a0a32c0a32ee38fd15afb14cccc5601d9">mpSetZero()</a>, and <a class="el" href="bigdigits_8h.html#ad7e9dd871ac50a08b8ccae4592ba120e">spSimpleRand()</a>.</p>

</div>
</div>
<a class="anchor" id="a153f831f4e86caa9d90109df71b15b45"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpRabinMiller </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true (1) if <code>w</code> is probably prime using just the Rabin-Miller test. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="bigdigits_8h.html#afee0546db3e24c672b9bc35fbe3d24ca" title="Returns true (1) if w is probably prime. ">mpIsPrime()</a> is preferred. </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a4688fa13c48155ed2cfc18ebef0e838f">mpCompare()</a>, <a class="el" href="bigdigits_8h.html#a328c19b60c24beb9f1f3a6b8cf341aa2">mpIsZero()</a>, <a class="el" href="bigdigits_8h.html#a4ca7d847e83c72e810774d3c8faf3d42">mpModExp()</a>, <a class="el" href="bigdigits_8h.html#ab38130bb56dec16ad7ee185182e689e0">mpModMult()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#a0a32c0a32ee38fd15afb14cccc5601d9">mpSetZero()</a>, <a class="el" href="bigdigits_8h.html#aaab56ae575c4e3bc18d5a89df21c53f7">mpShiftRight()</a>, <a class="el" href="bigdigits_8h.html#ad6970367c69eee9ed5c65e140b067cf3">mpShortAdd()</a>, <a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp()</a>, <a class="el" href="bigdigits_8h.html#acf60cb91d9bf64b9ab8cd6c7995a2c6f">mpShortSub()</a>, and <a class="el" href="bigdigits_8h.html#a89d8fb72ea0b381ce9099b09901cec10">mpSizeof()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#afee0546db3e24c672b9bc35fbe3d24ca">mpIsPrime()</a>.</p>

</div>
</div>
<a class="anchor" id="a446a5ab32deeb02277479dff4953e13e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpSetBit </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets bit n of a (0..nbits-1) with value 1 or 0. </p>

</div>
</div>
<a class="anchor" id="afe97063d506389797a9647a8803edc65"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpSetDigit </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets a = d where d is a single digit. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#a81f43e382a5babc239c97b076fe7829b">mpModExp_ct()</a>, and <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>.</p>

</div>
</div>
<a class="anchor" id="aa40ded0449ebaf383877100804197948"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpSetEqual </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets a = b. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a4bcb8a0e0ed0e1fbfac8fd507c75bc1a">mpAbs()</a>, <a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, <a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi()</a>, <a class="el" href="bigdigits_8h.html#a81f43e382a5babc239c97b076fe7829b">mpModExp_ct()</a>, <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, <a class="el" href="bigdigits_8h.html#a8e3034074cb07fb9b9764d3448c03ab6">mpModulo()</a>, <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>, and <a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt()</a>.</p>

</div>
</div>
<a class="anchor" id="a0a32c0a32ee38fd15afb14cccc5601d9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpSetZero </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets a = 0. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#af17b0b6a122dad76d5c447f0e5979535">mpConvFromOctets()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, <a class="el" href="bigdigits_8h.html#a3df35cea910a1b2ddd4a0f909b11fe5e">mpQuickRandBits()</a>, and <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="af6837bac786e6c592602feb8a37c52d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShiftLeft </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes a = b &lt;&lt; x. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, and <a class="el" href="bigdigits_8h.html#a2057382ebab06472fed38f5b71399f6a">mpShortDiv()</a>.</p>

</div>
</div>
<a class="anchor" id="aaab56ae575c4e3bc18d5a89df21c53f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShiftRight </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes a = b &gt;&gt; x. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, <a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi()</a>, <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>, and <a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt()</a>.</p>

</div>
</div>
<a class="anchor" id="ad6970367c69eee9ed5c65e140b067cf3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShortAdd </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes w = u + d, returns carry. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a8666a8cd063b0aeb53956f14edd219ff">mpChs()</a>, and <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="a54a5d832ff76748576c7447d7eeb8e7d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpShortCmp </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns sign of (a - d) where d is a single digit. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot()</a>, <a class="el" href="bigdigits_8h.html#afee0546db3e24c672b9bc35fbe3d24ca">mpIsPrime()</a>, <a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi()</a>, <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>, <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>, and <a class="el" href="bigdigits_8h.html#a0d06f675857ffa2d8cf5c06e40ce1f98">mpSqrt()</a>.</p>

</div>
</div>
<a class="anchor" id="a2057382ebab06472fed38f5b71399f6a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShortDiv </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>q</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes quotient q = u div d, returns remainder. </p>

<p>References <a class="el" href="bigdigits_8h.html#af6837bac786e6c592602feb8a37c52d5">mpShiftLeft()</a>, and <a class="el" href="bigdigits_8h.html#a3bdaee33308ee8393ba8bae4fe8f4220">spDivide()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a453714cb1ce75fc02fceceaf8b35a75a">mpCubeRoot()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, and <a class="el" href="bigdigits_8h.html#aa248383631135e0a8504d2bd569fbce2">mpShortMod()</a>.</p>

</div>
</div>
<a class="anchor" id="aa248383631135e0a8504d2bd569fbce2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShortMod </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes remainder r = a mod d. </p>

<p>References <a class="el" href="bigdigits_8h.html#a2057382ebab06472fed38f5b71399f6a">mpShortDiv()</a>.</p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#afee0546db3e24c672b9bc35fbe3d24ca">mpIsPrime()</a>, and <a class="el" href="bigdigits_8h.html#a32626062a7c127eed845c799c2176c38">mpJacobi()</a>.</p>

</div>
</div>
<a class="anchor" id="a86a47b90849a08b00a9030d3ca076144"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShortMult </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>p</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes product p = x * d. </p>

<p>References <a class="el" href="bigdigits_8h.html#a8479a1c0578e65b051674817c5bd77b9">spMultiply()</a>.</p>

</div>
</div>
<a class="anchor" id="acf60cb91d9bf64b9ab8cd6c7995a2c6f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpShortSub </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes w = u - d, returns borrow. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a8666a8cd063b0aeb53956f14edd219ff">mpChs()</a>, and <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="a89d8fb72ea0b381ce9099b09901cec10"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t mpSizeof </td>
          <td>(</td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns number of significant non-zero digits in a. </p>
<p>Returns number of significant non-zero digits in a. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a1a73f82be10b0ca4c8a7e51c52bad262">mpBitLength()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#a81f43e382a5babc239c97b076fe7829b">mpModExp_ct()</a>, and <a class="el" href="bigdigits_8h.html#a153f831f4e86caa9d90109df71b15b45">mpRabinMiller()</a>.</p>

</div>
</div>
<a class="anchor" id="a0d06f675857ffa2d8cf5c06e40ce1f98"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpSqrt </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>s</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes integer square root s = floor(sqrt(x)) </p>

<p>References <a class="el" href="bigdigits_8h.html#a77bf097cd0692608f06b524ff1ef04db">mpAdd()</a>, <a class="el" href="bigdigits_8h.html#a4688fa13c48155ed2cfc18ebef0e838f">mpCompare()</a>, <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, <a class="el" href="bigdigits_8h.html#aa40ded0449ebaf383877100804197948">mpSetEqual()</a>, <a class="el" href="bigdigits_8h.html#aaab56ae575c4e3bc18d5a89df21c53f7">mpShiftRight()</a>, and <a class="el" href="bigdigits_8h.html#a54a5d832ff76748576c7447d7eeb8e7d">mpShortCmp()</a>.</p>

</div>
</div>
<a class="anchor" id="ac2504130118989f74890ebe55abf2beb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpSquare </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>x</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes square w = x^2. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">w</td><td>array of size 2 x <code>ndigits</code> to receive square </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">x</td><td>array of size <code>ndigits</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">ndigits</td><td>size of array <code>x</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>The product <code>w</code> must be of size 2 x <code>ndigits</code> </dd></dl>

<p>References <a class="el" href="bigdigits_8h.html#a8479a1c0578e65b051674817c5bd77b9">spMultiply()</a>.</p>

</div>
</div>
<a class="anchor" id="aa160f8403c9e4e296c4cfe1afa98f5d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 mpSubtract </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>w</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>v</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes w = u - v, returns borrow. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#ae0571c6d22df02f1d06ad35d85df6f67">mpGcd()</a>, and <a class="el" href="bigdigits_8h.html#a644f6447391ea04fdb9ba7f8b5d78de7">mpModInv()</a>.</p>

</div>
</div>
<a class="anchor" id="a5593505351c9c1938ad52404c8f9a44c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mpVersion </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns version number = major*1000+minor*100+release*10+PP_OPTIONS. </p>

</div>
</div>
<a class="anchor" id="ae8518e5f683a939df4e2e9f97ae51b2b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpXorBits </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>a</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>b</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>c</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>ndigits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes bitwise a = b XOR c. </p>

</div>
</div>
<a class="anchor" id="a3bdaee33308ee8393ba8bae4fe8f4220"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 spDivide </td>
          <td>(</td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>u</em>[2], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes quotient q = u div v, remainder r = u mod v, where q, r and v are single digits. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a2a9beba8b1b46a0f415197f512dff569">mpDivide()</a>, and <a class="el" href="bigdigits_8h.html#a2057382ebab06472fed38f5b71399f6a">mpShortDiv()</a>.</p>

</div>
</div>
<a class="anchor" id="a8479a1c0578e65b051674817c5bd77b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int spMultiply </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>p</em>[2], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes p = x * y, where x and y are single digits. </p>

<p>Referenced by <a class="el" href="bigdigits_8h.html#aa57007f55945e5caad5fa4e4da0ab2ec">mpMultiply()</a>, <a class="el" href="bigdigits_8h.html#a86a47b90849a08b00a9030d3ca076144">mpShortMult()</a>, and <a class="el" href="bigdigits_8h.html#ac2504130118989f74890ebe55abf2beb">mpSquare()</a>.</p>

</div>
</div>
<a class="anchor" id="ad7e9dd871ac50a08b8ccae4592ba120e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 spSimpleRand </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>lower</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>upper</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a simple pseudo-random digit between lower and upper. </p>
<dl class="section remark"><dt>Remarks</dt><dd>Not crypto secure. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd>spBetterRand() </dd></dl>

<p>Referenced by <a class="el" href="bigdigits_8h.html#a3df35cea910a1b2ddd4a0f909b11fe5e">mpQuickRandBits()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
